<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" charset="UTF-8">var projectPath = "<%=basePath %>";</script>
<script type="text/javascript" src="<%=basePath %>/resource/js/common-css-js.js" charset="UTF-8"></script>
<title>大旗科技有限公司--供应商欠款--添加页面</title>
<style>
	body {
		padding: 20px;
	}
</style>
</head>
<body>
	<form class="layui-form">
	  <div class="layui-form-item">
	      <input type="text" id="supplierName" name="supArreSupplierName" required  lay-verify="required" placeholder="供应商名称" autocomplete="off" class="layui-input">
	      <p id="Prompt"></p>
	  </div>
	  <div class="layui-form-item">
	      <input type="text" name="supArreLastYearArrears" lay-verify="intNumber" placeholder="去年余款" autocomplete="off" class="layui-input">
	  </div>
	  <div class="layui-form-item">
	      <input type="text" name="supArreJanuary" lay-verify="intNumber" placeholder="一月应付" autocomplete="off" class="layui-input">
	  </div>
	  <div class="layui-form-item">
	      <input type="text" name="supArreFebruary" lay-verify="intNumber" placeholder="二月应付" autocomplete="off" class="layui-input">
	  </div>
	  <div class="layui-form-item">
	      <input type="text" name="supArreMarch" lay-verify="intNumber" placeholder="三月应付" autocomplete="off" class="layui-input">
	  </div>
	  <div class="layui-form-item">
	      <input type="text" name="supArreApril" lay-verify="intNumber" placeholder="四月应付" autocomplete="off" class="layui-input">
	  </div>
	  <div class="layui-form-item">
	      <input type="text" name="supArreMay" lay-verify="intNumber" placeholder="五月应付" autocomplete="off" class="layui-input">
	  </div>
	  <div class="layui-form-item">
	      <input type="text" name="supArreJune" lay-verify="intNumber" placeholder="六月应付" autocomplete="off" class="layui-input">
	  </div>
	  <div class="layui-form-item">
	      <input type="text" name="supArreJuly" lay-verify="intNumber" placeholder="七月应付" autocomplete="off" class="layui-input">
	  </div>
	  <div class="layui-form-item">
	      <input type="text" name="supArreAugust" lay-verify="intNumber" placeholder="八月应付" autocomplete="off" class="layui-input">
	  </div>
	  <div class="layui-form-item">
	      <input type="text" name="supArreSeptember" lay-verify="intNumber" placeholder="九月应付" autocomplete="off" class="layui-input">
	  </div>
	  <div class="layui-form-item">
	      <input type="text" name="supArreOctober" lay-verify="intNumber" placeholder="十月应付" autocomplete="off" class="layui-input">
	  </div>
	  <div class="layui-form-item">
	      <input type="text" name="supArreNovember" lay-verify="intNumber" placeholder="十一月应付" autocomplete="off" class="layui-input">
	  </div>
	  <div class="layui-form-item">
	      <input type="text" name="supArreDecember" lay-verify="intNumber" placeholder="十二月应付" autocomplete="off" class="layui-input">
	  </div>
	  <div class="layui-form-item">
	      <input type="text" name="supArreRemark" placeholder="备注" autocomplete="off" class="layui-input">
	  </div>
	  <%@include file="/admin/commonsPage/submit-reset.html" %>
	</form>
	<script type="text/javascript">
		$(function(){
			var supplierObj = $("#supplierName");
			supplierObj.mouseout(function(){
				var supplierName = supplierObj.val();
				if(supplierName!=""){
					$.ajax({
					   type: 'GET',
					   url: path+"/financial/supplier-arrears/exist",
					   data: {supplierName:''+supplierName+''},
					   contentType: "application/x-www-form-urlencoded;charset='UTF-8'", 
					   error: function(XMLHttpRequest, textStatus, errorThrown) {
						   $("#submit-btn").attr("disabled","disabled");
						   $("#submit-btn").addClass("layui-btn-disabled");
						   $("#Prompt").html("<font color='red'>该供应商已存在,请更换供应商!否则无法提交</font>");
					   },
					   success: function(msg){
						   $("#submit-btn").removeAttr("disabled");
						   $("#submit-btn").removeClass("layui-btn-disabled");
						   $("#Prompt").html("<font color='green'>可以添加该供应商</font>");
					   }
				    });
				}
			})
			requestAddData("/financial/supplier-arrears");
		})
	</script>
</body>
</html>